using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class PRF_PreferenceMap : EntityTypeConfiguration<PRF_Preference>
    {
        public PRF_PreferenceMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Type)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.Station)
                .HasMaxLength(50);

            this.Property(t => t.ObjectType)
                .HasMaxLength(50);

            this.Property(t => t.ObjectName)
                .HasMaxLength(50);

            this.Property(t => t.Prefrence)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("PRF_Preference");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Station).HasColumnName("Station");
            this.Property(t => t.User).HasColumnName("User");
            this.Property(t => t.ObjectType).HasColumnName("ObjectType");
            this.Property(t => t.ObjectName).HasColumnName("ObjectName");
            this.Property(t => t.Prefrence).HasColumnName("Prefrence");
        }
    }
}
